package com.wantup.controller.v3;

import com.wantup.model.InMessage;
import com.wantup.service.WebSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;

/**
 * @ClassName ChatRoomControllerV3
 * @Description 简单版单人聊天
 * @Author zhaoluowei
 * @Date 2019/6/23  20:34
 * @Version 1.0
 */

@Controller
public class ChatRoomControllerV3 {

    @Autowired
    private WebSocketService webSocketService;

    @MessageMapping(value = "/v3/single/chat")//消息的路由
    public void singleChat(InMessage inMessage){
        System.out.println(inMessage);
        webSocketService.sendChatMessage(inMessage);
    }

}
